﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NUnit.Framework;

using BOSS.Framework.Search;
using BOSS.Framework.Search.Context;
using BOSS.Framework.Search.Result;
using BOSS.Service.Security;
using BOSS.Domain.Security;
using BOSS.Dao.Security;

namespace Test.BOSS.Service.Implements.Security
{
    [TestFixture]
    public class TestAccountService : TestCase
    {
        public IAccountDao AccountDao { get; set; }

        public ISearchService SearchService { get; set; }

        public IAccountService AccountService { get; set; }

        [Test]
        public void Test()
        {
            Assert.IsNotNull(this.AccountDao);
        }

        [Test]
        public void TestSearch()
        {
            ISearchContext context = this.SearchService.CreateContext("Account");

            Assert.IsNotNull(context);

            context.SetFilter("FullName", "admin");
            context.SetFilter("Creator", "admin");

            ISearchResult result = this.SearchService.Search(context);

            foreach (Account item in result.UnderlayerItems)
	        {
                Console.WriteLine(string.Format("{0} {1} {2}", item.FullName, item.Mobile, item.QQ));    
	        } 

            //this.AccountService.Save(AccountService)
        }
    }
}
